package com.example.rabbitmqstudy.service;

import java.util.Map;
import java.util.Map;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.example.rabbitmqstudy.constant.RabbitConstant;

/**
 * @author admin
 * @date 2021/07/14 17:48
 */
@Component
public class RabbitTopicsConsumer {

    @RabbitListener(queues = RabbitConstant.TOPICS_FIRST_QUEUE_NAME)
    @RabbitHandler
    public void topicFirstQueue(String context){

        System.out.println("rabbit topics queue first receiver: " + context);
    }
    @RabbitHandler
    @RabbitListener(queues = RabbitConstant.TOPICS_SECOND_QUEUE_NAME)
    public void topicSecondQueue(String context){
        System.out.println("rabbit topics queue second receiver: " + context);
    }
    @RabbitHandler
    @RabbitListener(queues = RabbitConstant.TOPICS_THIRD_QUEUE_NAME)
    public void topicThirdQueue(String context){
        System.out.println("rabbit topics queue third receiver: " + context);
    }
}
